package java101;

import javax.swing.*;

public class ComboBox {

	static int i1;
	static int i2;
	static int i3;
	
	public static void main(String[] args) {
		
		JSpinner hours = new JSpinner(
				new SpinnerNumberModel (0, 0, 12, 1));
		JSpinner minutes = new JSpinner(
				new SpinnerNumberModel (0, 0, 59, 1));
		JSpinner seconds = new JSpinner(
				new SpinnerNumberModel (0, 0, 59, 1));
		JPanel panel = new JPanel();
		panel.add(hours);
		panel.add(minutes);
		panel.add(seconds);
		JOptionPane.showMessageDialog(null, panel);
		
		int h = (Integer)hours.getValue();
		int m = (Integer)minutes.getValue();
		int s = (Integer)seconds.getValue();
for (i1 = s; i1 >= 0; ){
	i1--;
	if (i1 == -1 && i2 > 0){
		i1 = 59;
	}
try{	
	Thread.sleep(1000);
	}
catch (InterruptedException e)
{}
i2 = m;
if (i1 <= 0 && i2 > 0){
m--;

i3 = h;
if (i2 <= 0 && i3 > 0){
	h--;
}
}
if (i1 != -1){
System.out.println(i3 + " : " + i2 + " . " + i1);
}

}
	}
}
